package com.arofoxmsn.model;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

import com.arofoxmsn.model.comunication.AbstractComunicationMedia;
import com.arofoxmsn.model.location.Location;
@Entity
public class PhotoAlbum {
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
    @Column(name = "id", unique = true, nullable = false)
	private int id;
	
	private String name;
	
	private String description;
	
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	private Location location;
	
	@OneToMany(targetEntity=Picture.class, mappedBy="album",cascade=CascadeType.ALL, fetch=FetchType.EAGER)
	private List<Picture> pictures = new ArrayList<Picture>();
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public Location getLocation() {
		return location;
	}
	public void setLocation(Location location) {
		this.location = location;
	}
	public List<Picture> getPictures() {
		return pictures;
	}
	public void setPictures(List<Picture> pictures) {
		this.pictures = pictures;
	}
}
